package be.fedict.eid.diagnostics.tests;

import be.fedict.eid.diagnostics.DiagnosticTest;
import be.fedict.eid.diagnostics.TestFailedException;
import be.fedict.eid.diagnostics.annotations.TestName;
import be.fedict.eid.diagnostics.helper.DataTreeBuilder;
import be.fedict.eid.diagnostics.system.OperatingSystem;

@TestName("Data Acquisition: Operating System Information")
public class ReportOperatingSystemTest extends DiagnosticTest {

	
	protected boolean runTest() throws TestFailedException {
		
		OperatingSystem os;
		try {
			os = new OperatingSystem();
			
			rootNode.add(DataTreeBuilder.buildNode("name", os.getName()));
			rootNode.add(DataTreeBuilder.buildNode("arch", os.getArchitecture()));
			rootNode.add(DataTreeBuilder.buildNode("version", os.getVersion()));
			
		} catch (Exception e) {
			throw new TestFailedException("Could not establish type of Operating System.");
		}
		
		// Prepare Data Gathering Tree OS Information
		
		
		
		return true;
		
	}

	protected String getRootName() {
		return "os";
	}

}
